<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Main extends DR_Controller {
	
	public function __Construct()
	{
		parent::__Construct();
		$this->set_layout("layout/layout");
	}
	
	public function cari()
	{
		$data = array("nama"=>"index");
		$this->show_view("main/index",$data);	
	}
	
	public function index()
	{
		$data = array("nama"=>"index");
		$this->show_view("main/index",$data);
	}
	
	public function page($page_name=null)
	{
		$this->load->model("halaman");
		$data["c_hal"] = $this->halaman->get_by_judul_file($page_name);
		$this->show_view("main/page",$data);
	}
	
	public function daftar()
	{
		$data = array("title"=>"Pendaftaran");
		$this->set_view("main/layout_daftar","main/daftar",$data);
	}
	
	public function pencarian_lengkap()
	{
	}
	
	public function proses_pendaftaran()
	{
		$nama = $this->read_post("nama");
		$email = $this->read_post("email");
		$password = $this->read_post("password");
		
		$this->load->model("user");
		if(!$this->user->email_exists($email) && valid_email($email))
		{
			$this->user->add($nama,$password,$email);
		}
	}
	
	public function pendaftaran_sukses()
	{
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */